﻿using System;
using System.Data;
using System.Data.Common;
using Liger.Common;
using Liger.Data;

namespace EasyFMS.Model
{

	/// <summary>
	/// 实体类tUserDepartment
	/// </summary>
	[Serializable]
	public class tUserDepartment : Entity 
	{ 
		 public tUserDepartment() 
            : base("tUserDepartment") 
        { 

        }


		#region Model
		private int _UID;
		private int? _UserID;
		private int? _DepartmentID;
		private int? _UserCreateID;
		private string _CreateDate;
	 
		/// <summary>
		/// 
		/// </summary>
		public int UID
		{
			get{ return _UID; }
			set
			{
				this.OnPropertyValueChange(_.UID,_UID,value);
				this._UID = value;
			}
		}
		/// <summary>
		/// 
		/// </summary>
		public int? UserID
		{
			get{ return _UserID; }
			set
			{
				this.OnPropertyValueChange(_.UserID,_UserID,value);
				this._UserID = value;
			}
		}
		/// <summary>
		/// 
		/// </summary>
		public int? DepartmentID
		{
			get{ return _DepartmentID; }
			set
			{
				this.OnPropertyValueChange(_.DepartmentID,_DepartmentID,value);
				this._DepartmentID = value;
			}
		}
		/// <summary>
		/// 
		/// </summary>
		public int? UserCreateID
		{
			get{ return _UserCreateID; }
			set
			{
				this.OnPropertyValueChange(_.UserCreateID,_UserCreateID,value);
				this._UserCreateID = value;
			}
		}
		/// <summary>
		/// 
		/// </summary>
		public string CreateDate
		{
			get{ return _CreateDate; }
			set
			{
				this.OnPropertyValueChange(_.CreateDate,_CreateDate,value);
				this._CreateDate = value;
			}
		}
		#endregion

		#region Method
		/// <summary>
		/// 获取实体中的标识列
		/// </summary>
		public override Field GetIdentityField()
		{
			return _.UID;
		}
		/// <summary>
		/// 获取实体中的主键列
		/// </summary>
		public override Field[] GetPrimaryKeyFields()
		{
			return new Field[] {
				_.UID			};
		}
		/// <summary>
		/// 获取列信息
		/// </summary>
		public override Field[] GetFields()
		{
			return new Field[] {
				_.UID,
				_.UserID,
				_.DepartmentID,
				_.UserCreateID,
				_.CreateDate
			};
		}
		/// <summary>
		/// 获取值信息
		/// </summary>
		public override object[] GetValues()
		{
			return new object[] {
				_UID,
				_UserID,
				_DepartmentID,
				_UserCreateID,
				_CreateDate
			};
		} 
		/// <summary>
		/// 设置字段值
		/// </summary>
		public override void SetValue(string fieldName, object value)
        {
            switch (fieldName)
            { 
				case "UID":
                    this._UID = DataHelper.ConvertValue<int>(value);
                    break; 
				case "UserID":
                    this._UserID = DataHelper.ConvertValue<int?>(value);
                    break; 
				case "DepartmentID":
                    this._DepartmentID = DataHelper.ConvertValue<int?>(value);
                    break; 
				case "UserCreateID":
                    this._UserCreateID = DataHelper.ConvertValue<int?>(value);
                    break; 
				case "CreateDate":
                    this._CreateDate = DataHelper.ConvertValue<string>(value);
                    break; 
            }
        }
		/// <summary>
		/// 获取字段值
		/// </summary>
        public override object GetValue(string fieldName)
        {
            switch (fieldName)
            { 
				case "UID":
                    return this._UID; 
				case "UserID":
                    return this._UserID; 
				case "DepartmentID":
                    return this._DepartmentID; 
				case "UserCreateID":
                    return this._UserCreateID; 
				case "CreateDate":
                    return this._CreateDate; 
				default :
                    return null;
            } 
        }



		#endregion

		#region _Field
		/// <summary>
		/// 字段信息
		/// </summary>
		public class _
		{
			/// <summary>
			/// * 
			/// </summary>
			public readonly static Field All = new Field("*","tUserDepartment");
 
			/// <summary>
			/// 
			/// </summary>
			public readonly static Field UID = new Field("UID","tUserDepartment","UID");
			/// <summary>
			/// 
			/// </summary>
			public readonly static Field UserID = new Field("UserID","tUserDepartment","UserID");
			/// <summary>
			/// 
			/// </summary>
			public readonly static Field DepartmentID = new Field("DepartmentID","tUserDepartment","DepartmentID");
			/// <summary>
			/// 
			/// </summary>
			public readonly static Field UserCreateID = new Field("UserCreateID","tUserDepartment","UserCreateID");
			/// <summary>
			/// 
			/// </summary>
			public readonly static Field CreateDate = new Field("CreateDate","tUserDepartment","CreateDate");
		}
		#endregion

 
	}
}

